<{include file="../common/head.tpl"}>
<link type="text/css" href="/css/iframe.css" rel="stylesheet">
<script type="text/javascript">
function AutoResizeImage(maxWidth,maxHeight,objImg){
    var img = new Image();
    img.src = objImg.src;
    var hRatio;
    var wRatio;
    var Ratio = 1;
    var w = img.width;
    var h = img.height;
    wRatio = maxWidth / w;
    hRatio = maxHeight / h;
    if (maxWidth ==0 && maxHeight==0){
        Ratio = 1;
    }else if (maxWidth==0){
        if (hRatio<1) Ratio = hRatio;
    }else if (maxHeight==0){
    if (wRatio<1) Ratio = wRatio;
    }else if (wRatio<1 || hRatio<1){
        Ratio = (wRatio<=hRatio?wRatio:hRatio);
    }
    if (Ratio<1){
        w = w * Ratio;
        h = h * Ratio;
    }
        objImg.height = h;
        objImg.width = w;
}
</script>
<div class="main w1060 iframe">
        <!--<div style="padding:10px; border:1px solid #ccc; background-color:#eee;position: fixed;top: 0;"><p>播放MP4需下载安装QUICKTIME插件,<a href="/assets/QuickTimeInstaller_5200000014856956654.exe" target="_blank">下载</a>
WMV,AVI需要windown系统中安装WINDOW MEDIA PLAYER播放器，火狐浏览器需同时安装相应插件，<a href="/assets/wmpfirefoxplugin.exe" target="_blank">下载</a>,安装成功后火狐地址栏输入about:config查找选项plugins.load_appdir_plugins双击改为true</p></div>-->
        <h2><{if $net_info}><{$net_info.network_name}><{/if}><{if $question_info}>--<{$question_info.question_name}><{/if}><{if $subject_info}>--<{$subject_info.title}><{/if}></h2>
        <p style="line-height: 30px;font-size: 14px;"><{$subject_info.content}></p>
        <!--<{if $answer.answer_desc}><p style="line-height: 30px;font-size: 14px;color:red;"><{$answer.answer_desc}></p><{/if}>-->
        <ul>
        <{if $list}>
        <{foreach $list as $key => $val}>
        
        <{if $val.extension=='img'}>
        <li><{if isset($answer_desc_list[$key])}><{$answer_desc_list[$key]}><{/if}>
            <img src='<{$val.url}>' onload="AutoResizeImage(250,0,this)" style="vertical-align:middle;cursor: pointer;" onclick="show_big(this);"  alt="点击看大图" style="cursor:pointer" />
            <a href="<{$val.url}>" target="_blank" >下载</a>
        </li>
        <{/if}>
        
        <{if $val.ext=='mp3'}>
        <li><{if isset($answer_desc_list[$key])}><{$answer_desc_list[$key]}><{/if}>
            <embed height="30" width="200" autostart="false" loop="false" src="<{$val.url}>" />
            <a href="<{$val.url}>" target="_blank" >下载</a>
        </li>
        <{/if}>
        
        <{if $val.ext=='mp4'}>
        <li><{if isset($answer_desc_list[$key])}><{$answer_desc_list[$key]}><{/if}>
            <OBJECT ID=video1 CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT=200 WIDTH=200> 
            <param name="_ExtentX" value="9313"> 
            <param name="_ExtentY" value="7620"> 
            <param name="allowFullScreen" value="true">
            <param name="AUTOSTART" value="0"> 
            <param name="SHUFFLE" value="0"> 
            <param name="PREFETCH" value="0"> 
            <param name="NOLABELS" value="0"> 
            <param name="SRC" value="<{$val.url}>"> 
            <param name="CONTROLS" value="ImageWindow"> 
            <param name="CONSOLE" value="Clip1"> 
            <param name="LOOP" value="0"> 
            <param name="NUMLOOP" value="0"> 
            <param name="CENTER" value="0">
            <param name="scale" value="tofit" />
            <param name="controller" value="true" /> 
            <param name="autoplay" value="false" />
            <param name="ShowAudioControls" value="-1">
            <param name="MAINTAINASPECT" value="0"> 
            <param name="BACKGROUNDCOLOR" value="#000000">
            <EMBED SRC="<{$val.url}>" type="video/quicktime" PLUGINSPAGE="http://www.apple.com/quicktime/download" WIDTH="200" HEIGHT="200" scale="tofit" controller="true" autoplay="false"></EMBED> 
            </OBJECT> 
            <a href="<{$val.url}>" target="_blank" >下载</a>
        </li>
        <{/if}>

        <{if $val.ext=='wmv'}>
        <li><{if isset($answer_desc_list[$key])}><{$answer_desc_list[$key]}><{/if}>
            <object width="200" height="200" type="video/x-ms-asf" url="<{$val.url}>" data="<{$val.url}>" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
            <param name="url" value="<{$val.url}>">
            <param name="filename" value="<{$val.url}>">
            <param name="autostart" value="false">
            <param name="uiMode" value="full" />
            <param name="autosize" value="1">
            <param name="playcount" value="1">
            <embed type="application/x-mplayer2" src="<{$val.url}>" width="200" height="200" autostart="false" showcontrols="true" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"></embed>
            </object>
         <a href="<{$val.url}>" target="_blank" >下载</a>
        </li>
        <{/if}>
        
        <{if $val.ext=='avi'}>
        <li><{if isset($answer_desc_list[$key])}><{$answer_desc_list[$key]}><{/if}>
            <object width="200" height="200" type="video/x-ms-asf" url="<{$val.url}>" data="<{$val.url}>" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
            <param name="url" value="<{$val.url}>">
            <param name="filename" value="<{$val.url}>">
            <param name="autostart" value="false">
            <param name="uiMode" value="full" />
            <param name="autosize" value="1">
            <param name="playcount" value="1">
            <embed type="application/x-mplayer2" src="<{$val.url}>" width="200" height="200" autostart="false" showcontrols="true" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"></embed>
            </object>
            <a href="<{$val.url}>" target="_blank" >下载</a>
        </li>
        <{/if}>
        <{/foreach}>

        <{/if}>
        </ul>
<script>
//删除
function del(nqa_id){
    if (!confirm('确定删除')) {
        $.getJSON('/netquestion/delattach',{nqa_id:nqa_id},function(res){
            if (res.status==1) {
                $('#nqa_'+nqa_id).remove();
            }
            alert(res.note);
        });    
    }

}
//显示大图
function show_big(obj){
    var img = new Image();
    img.src = obj.src;
    var width = img.width + 10;
    var height = img.height + 10;
    var pageii = $.layer({
        type: 1,
        title: false,
        area: [width+'px', height+'px'],
        border: [0], //去掉默认边框
        shade: [0.2, '#000'], //去掉遮罩
        shadeClose: true,
        fix: false,
        offset: ['100px',''],
        closeBtn: [0, true], //去掉默认关闭按钮
        page: {
            html: '<div style="width:'+width+'px;height:'+height+'px;"><img src="'+obj.src+'"</div>'
        }
    });  
}

</script>
</div>
    </body>
</html>